//package com.github.xjs.admin.config;
//
//import java.util.ArrayList;
//import java.util.Collections;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
//import com.github.security.auth.client.interceptor.AppAuthRestInterceptor;
//
///**
// * @author xujiansheng
// * 
// */
//@Configuration("adminWebConfig")
//@Primary
//public class WebConfig extends WebMvcConfigurerAdapter{
//	 @Override
//   public void addInterceptors(InterceptorRegistry registry) {
//       ArrayList<String> commonPathPatterns = getExcludeCommonPathPatterns();
//       registry.addInterceptor(getAuthRestInterceptor()).addPathPatterns("/**")
//               .excludePathPatterns(commonPathPatterns.toArray(new String[]{}));
//       super.addInterceptors(registry);
//   }
//
//   @Bean
//   AppAuthRestInterceptor getAuthRestInterceptor() {
//       return new AppAuthRestInterceptor();
//   }
//
//   private ArrayList<String> getExcludeCommonPathPatterns() {
//       ArrayList<String> list = new ArrayList<>();
//       String[] urls = {
//               "/v2/api-docs",
//               "/swagger-resources/**",
//               "/cache/**"
//       };
//       Collections.addAll(list, urls);
//       return list;
//   }
//}
